<%-- Created by IntelliJ IDEA. --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
  <head>
    <title>疫苗接种预约系统</title>
  </head>
  <body>

  <%
    if (request.getAttribute("list") == null) {
      request.getRequestDispatcher("ListServlet").forward(request, response);
    }
  %>

<table>
  <button>
    <a href="Add.jsp">添加预约</a>
  </button>

            <tr style="background-color: #87888A" align="center">
              <th>预约人项目</th>
              <th>预约人身份证号</th>
              <th>接种状态</th>
              <th>接种日期</th>
              <th>操作</th>
            </tr>
            <c:forEach items="${list}" varStatus="jing" var="pan">
              <tr align="center" style="background-color: ${jing.index % 2 == 0 ? '':'#dcec2b'}">
                <td>${pan.userName}</td>
                <td>${pan.cardId}</td>
                <td>${pan.status == 0 ? "预约":"已接种"}</td>
                <td>${pan.bookingDate}</td>
                <td>
                    <a href="DleBooking?id=${pan.id}">删除</a>
                  <a href="Modify?id=${pan.id}">修改</a>
                </td>
              </tr>
            </c:forEach>
</table>
  <p>
    <a href="ListServlet?currPage=${param.currPage-1}">上一页</a>
    <a href="ListServlet?currPage=${param.currPage+1}">下一页</a>
  </p>
  </body>
</html>